<?php 

   class UploadAction extends Action{
   
        function index(){        	                      	               $this->display();
		}
		
	  function upload(){
		import('ORG.Net.UploadFile');
		$path=date("Ym").'/';
    $upload = new UploadFile();// 实例化上传类
    $upload->maxSize  = 3145728 ;// 设置附件上传大小
    $upload->allowExts  = array('jpg', 'gif', 'png', 'jpeg','rar','zip');// 设置附件上传类型
    $upload->savePath =  './Data/photo/'.$path;// 设置附件上传目录    if(!file_exists("./Data/photo/".$path)){    	mkdir("./Data/photo/".$path);    }
    if(!$upload->upload()) {
	
	// 上传错误提示错误信息
        $this->error($upload->getErrorMsg());
    }else{
         $info = $upload->getUploadFileInfo(); //获取上传结果信息
		  $photopath= str_replace(".","",$info[0]['savepath']);
         $s=$photopath.$info[0]['savename'];
          echo "<script>parent.notice('$s');</script>"; 
    }
		
	}
  }

?>